import { Component } from "react";
/* 引入路由模块 */
import { HashRouter as Router, Route, Switch } from "react-router-dom"
// import './iconfont.css';
import './App.css';
// import './mytest.css';
import Tabbar from "./components/Tabbar"
import Product from "./components/Product"
import Pay from "./components/Pay"
import Login from "./components/Login"
import Regist from "./components/Regist"
import Classify from "./components/Classify"
import Search from "./components/Search"
import Goodlist from "./components/Goodlist"
import Goodsdetails from "./components/Goodsdetails"

class App extends Component {
  
  render() {
    return (
      <Router>
        <div className="App">
          <Switch>
            {/* 产品详情页 */}
            <Route path="/product/:pid" exact component={Product}></Route>
            {/* 支付页 */}
            <Route path="/pay/:pid" exact component={Pay}></Route>
            {/* 注册页 */}
            <Route path="/regist" exact component={Regist}></Route>
            {/* 分类页 */}
            <Route path="/classify" exact component={Classify}></Route>
            {/* 商品列表 */}
            <Route path="/goodlist" exact component={Goodlist}></Route>
            {/* 商品详情2版 */}
            <Route path="/goodsdetails/:goodid" exact component={Goodsdetails}></Route>
            {/* 搜索页 */}
            <Route path="/search" exact component={Search}></Route>
            {/* 登录页 */}
            <Route path="/login" exact component={(props) => <Login {...props}></Login>} title="13"></Route>
            {/* 主页 */}
            <Route path="/" component={Tabbar}></Route>
          </Switch>

        </div>
      </Router>

    );
  }
  

  componentDidMount() {
    
  }
}

export default App;

